<template>
  <div id="left_ech2" style="width: 90%;height:230px;"></div>
</template>

<script>
export default {
  data() {
    return {
      leftlist: []
    };
  },
  mounted() {
    this.leftbottom();
  },
  methods: {
    leftbottom() {
      // 基于准备好的dom，初始化echarts实例
      let myChart = this.$echarts.init(document.getElementById("left_ech2"));
      // 绘制图表
      myChart.setOption({
        title: {
          text: "总线上下行数据量",
          left: "left",
          top: 10,
          textStyle: {
            color: "#4dd4f5",
            fontSize: 14,
            fontWeight: 400
          }
        },
        textStyle: {
          color: "white"
        },
        grid: {
          left: "3%",
          right: "4%",
          bottom: "23%",
          containLabel: true
        },
        legend: {
          data: ["上行流量", "下行流量"],
          right: 10,
          top: 10,
          textStyle: {
            color: "white"
          }
        },
        xAxis: {
          type: "category",
          boundaryGap: false,
          data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
        },
        yAxis: {
          type: "value"
        },
        series: [
          {
            name: "上行流量",
            color: ["#9d0f54"],
            data: [20, 72, 101, 134, 290, 330, 320],
            type: "line",
            areaStyle: {}
          },
          {
            name: "下行流量",
            color: "#5b50cc",
            data: [40, 102, 131, 164, 250, 350, 370],
            type: "line",
            areaStyle: {}
          }
        ]
      });
    }
   
  }
};
</script>